import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        sw: "",
        located: {
            uid: "",
            rid: "",
            cid: "",
        },
        query: {
            done: false,
            uid: "",
            type: "",
            shape: {},
            rid: "",
            cid: "",
        }
    },
    mutations: {
        setWs(state, ws) {
            state.ws = ws
        },
        setLocated(state, located) {
            state.located = located
        },
        setQuery(state, query) {
            state.query = query
        }
    },
    getters: {
        getLocated: state => state.located,
        getQuery: state => state.query,
        getWs: state => state.sw,
    },
    actions: {},
    modules: {}
})
